package cn.hfjava.kz.entity.po;

import cn.hfjava.kz.entity.vo.PermissionTreeVO;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
 * 权限表
 * @TableName permissions
 */
@TableName(value ="permissions")
@Getter
@Setter
public class Permission implements Serializable {

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public Permission() {
        //this.children = new ArrayList<>();
    }

    /**
     * 权限编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 权限名称
     */
    @TableField(value = "title")
    private String title;

    /**
     * 父节点ID 默认值0
     */
    @TableField(value = "pid")  // parentId 父节点ID
    private Integer pid;

    /**
     * 祖级列表
     */
    @TableField(value = "pids")  // 0,1
    private String pids;

    /**
     * 菜单类型权限标识 0表示目录，1表示菜单，2表示按钮
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 菜单图标
     */
    @TableField(value = "icon")
    private String icon;

    /**
     * 权限标识
     */
    @TableField(value = "perms")
    private String perms;

    /**
     * 路由地址
     */
    @TableField(value = "url")
    private String url;

    /**
     * 组件名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 组件路径
     */
    @TableField(value = "path")
    private String path;

    /**
     * 子节点集合
     */
    @TableField(exist = true)
    private List<Permission> children;

}